<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>邮件主页</title>
        <script type="text/javascript" src=""></script>
        <script type="text/javascript">
            function goList(obj){
                var iframe = document.getElementById("main");
                iframe.src="listMail.htm?folderName="+encodeURIComponent(obj);
                iframe.onreadystatechange=stateChangeIE(this);
                iframe.onload=stateChangeFirefox(this);
            }
        </script>
    </head>
    <body style="background-color: #99ccff">
        <table style="width: 100%;height: 100%;" border="2">
            <thead >
            <div align="center" ><p>webMail 接收、发送系统</p></div>
            </thead>
            <tbody >
                <tr>
                    <td width="100px">
                        <c:forEach var="folder" items="${allFolders}">
                            <div><a href="#" onclick="goList('${folder.name}');">${folder.name}</a></div>
                        </c:forEach>
                    </td>
                    <td height="100%" align="center" >
                        <div style="position: relative; width: 100px; height: 100px;float: inherit " id="load"><img src="progressBar_m.gif" />&nbsp;加载...</div>
                        <iframe id="main" style="visibility:hidden" onreadystatechange=stateChangeIE(this) onload=stateChangeFirefox(this) name="callframe" id="callframe" width="100%" height="600" frameborder="0" scrolling="no" marginheight="0">
                        </iframe>
<!--                        <iframe id="main" src="listMail.htm?folderName=INBOX" style="height: 100%;width: 100%"/>-->
                        <script>
                            function stateChangeIE(_frame)
                            {
                             if (_frame.readyState=="interactive")//state: loading ,interactive,   complete
                             {
                             var loader = document.getElementById("load");
                                loader.style.display = "none";
                                _frame.style.visibility = "visible";
                             }
                            }
                            function stateChangeFirefox(_frame)
                            {
                             var loader = document.getElementById("load");
                                loader.style.display = "none";
                                _frame.style.visibility = "visible";
                            }
                            callframe.location.href="listMail.htm?folderName=INBOX";
                            function reload(){
                               document.getElementById("load").style.display = 'block';
                               document.getElementById('callframe').style.visibility = 'hidden';
                            }
                        </script>
                    </td>
                </tr>
            </tbody>
        </table>
    </body>
</html>
